<template>
  <section class="meChat_ms">
    <Contacts @jump="jump" />
    <FriendPanner :params="params" />
  </section>
</template>
<script>
import { defineComponent, ref, onMounted, provide, watch } from 'vue';
import Contacts from './Contacts/index.vue'
import FriendPanner from './FriendPanner'
import { useStore } from 'vuex';
export default defineComponent({
  name: "Friend",
  components: {
    Contacts,
    FriendPanner
  },
  setup () {
    const params = ref("default")
    const store = useStore()
    store.subscribeAction((actionPayload) => {
      if (actionPayload?.type === 'getFriendByType') {
        if (actionPayload.payload?.params) params.value = actionPayload.payload?.params
      }
    })
    const jump = (info) => {
      if (info === '-1' || info === '-2') {
        store.dispatch('checkApplyList')
      }
      params.value = info
    }
    return {
      params,
      jump
    }
  }
})
</script>

<style scoped lang="less">
.meChat_ms {
  display: flex;
  width: 100%;
  height: 100%;
}
</style>
